package com.easyweb.session;

import com.easyweb.entity.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("illerHome")
public class IllerHome extends EntityHome<Iller> {

	@In(create = true)
	BolgeHome bolgeHome;
	@In(create = true)
	UlkeHome ulkeHome;

	public void setIllerId(BigDecimal id) {
		setId(id);
	}

	public BigDecimal getIllerId() {
		return (BigDecimal) getId();
	}

	@Override
	protected Iller createInstance() {
		Iller iller = new Iller();
		return iller;
	}

	public void load() {
		if (isIdDefined()) {
			wire();
		}
	}

	public void wire() {
		getInstance();
		Bolge bolge = bolgeHome.getDefinedInstance();
		if (bolge != null) {
			getInstance().setBolge(bolge);
		}
		Ulke ulke = ulkeHome.getDefinedInstance();
		if (ulke != null) {
			getInstance().setUlke(ulke);
		}
	}

	public boolean isWired() {
		return true;
	}

	public Iller getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

 

 
 
 

 

}
